package cate.game.role.pvp.championrace.msg;

import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBChampionRace;

@ClientMsg(title = "跨服冠军赛竞猜的请求")
public class ChampionRaceBetReq implements MsgInput {
    public String uid;
    public byte side;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        this.uid = cc.getRole().getUid();
        GameResult<Void> r = cc.getRole().getPvp().championRace.doBet(this);
        if (!r.ok()) {
            game.notice.message(cc.getRole(), r);
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBChampionRace.BET_REQ;
    }
}
